<template>
  <el-tag :type="priorityType" size="small">
    {{ priorityText }}
  </el-tag>
</template>

<script>
import { computed } from 'vue'

export default {
  name: 'PriorityRenderer',
  props: {
    value: {
      type: String,
      default: ''
    }
  },
  setup(props) {
    const priorityType = computed(() => {
      const typeMap = {
        high: 'danger',
        medium: 'warning',
        low: 'info'
      }
      return typeMap[props.value] || 'info'
    })
    
    const priorityText = computed(() => {
      const textMap = {
        high: '高',
        medium: '中',
        low: '低'
      }
      return textMap[props.value] || '未设置'
    })
    
    return {
      priorityType,
      priorityText
    }
  }
}
</script> 